<?php
	include("event-config.php");
	
	$event_id = 	$_POST['id'];
	$name = 		$_POST['name'];
	$start_date = 	$_POST["startDate"];
	$end_date = 	$_POST["endDate"];
	$benefit = 		$_POST["benefit"];
	$description = 	$_POST["description"];
	$slot = 		$_POST["slot"];
	$date = 		date('Y-m-d H:i:s');

	$query = "UPDATE $EVENT SET `name`='$name', `start_date`='$start_date',
								`end_date`='$end_date', `benefit`='$benefit',
								`description`='$description', `slot`='$slot', `post_date`='$date'
	WHERE `event_id` = '$event_id'";
	
	if(!execute($query)){
		echo "fail";
	}
	else{
		echo "success";
	}
?>